Bentley Map V8i (SELECTseries 10) Help

Script Validation

Validation rules define the graphical element process, as well as the associated database attributes. The validation rules can alter the graphical appearance (symbology, font, text size, cell name, scale, etc.), add new graphical elements, change or add feature linkages, review or modify existing database attributes or attach a new database record. A script does not have to change anything; some scripts only review the graphical elements and database attributes and write a report file.

The validation rules in a script are defined in a block starting with the keyword VALIDATE and ending with the keyword END. Between these two keywords, it is possible to have any number of script commands that define what is to be done with the graphical element and the associated database attributes.

For defining validation rules in blocks starting with the keyword VALIDATE and ending with the keyword END, the LV keyword has been enhanced to support both level number and level names. For example the syntax LV = 10 will move the current element to level number 10 while LV = 'my thematic results' will move the element to the level named 'my thematic results'. In either case if the specified level number or level name cannot be located, a new level is created to satisfy the request.

Example:



These validation rules resymbolize the graphical element by modifying the level to 10, the color to 3, the line weight to 1 and the line style to 0.

The validation part of a script performs the following operations on each graphical element that is accepted by the SETUP filters:

  • The built-in variables are initialized based on the symbology and other graphical attributes.

  • If the element is attached to a database record, the record will be read and the database variables defined using the values from the record. The rules in the validate block are executed from top to bottom.

  • When the validate block ends, the script examines which built-in and database variables have been updated in the script, if any. If the built-in variables have been updated, the graphical element is updated with the new symbology. If the database variables have been updated, the database record is updated with these values.

  • The script examines if any of the special control variables (DELETE, COPY, STRIP, etc.) have been used, in which case the appropriate action is performed.

Note: Only elements that are accepted by the SETUP filters will be validated. Only graphics in the active design file can be modified, and only database attribute values link to graphics in the active design file can be updated.

Note: If the control variable TEMP is TRUE at the end of validation, no changes are made to the graphical elements or to the database. If the control variable DELETE is TRUE at the end of validation, the graphical element is deleted, but not the associated database record, if any.